package support

import (
	"context"
	"v8s/test/containers/mongodb"

	"v8s-api/internal/configuration"
	"v8s-api/internal/db"
	"v8s-api/test/support/helpers"
)

type (
	ApplicationContext struct {
		MongoHelper *helpers.MongoHelper
	}
)

func GetApplicationContext(ctx context.Context, mongodb *mongodb.Container) *ApplicationContext {
	mongoProperties := configuration.MongoProperties{
		ConnectionURI: mongodb.ConnectionURI(),
		Database:      "test-database",
	}
	mongoClient := db.CreateMongoClient(ctx, mongoProperties)
	//databaseRepository := db.CreateProjectsRepository(mongoClient, mongoProperties)
	mongoHelper := helpers.CreateMongoHelper(mongoClient, mongoProperties)

	return &ApplicationContext{

		MongoHelper: mongoHelper,
	}
}
